package com.flyxteam.commons.httpclient;

import java.util.Map;

import javax.servlet.http.Cookie;

/**
 * HttpClient工具类
 * @author BZX
 */
public class HttpClientUtil {
	
	private static HttpClientSession session = HttpClientSessionFactory.createSession(15000, 15000, "UTF-8");//默认15秒超时
	
	/**
	 * 执行get请求
	 * @param url			请求url
	 * @param httpParams	请求参数
	 * @param headers		请求头
	 * @param config		配置
	 * @param cookies		cookies
	 * @return
	 * @throws HttpClientTimeoutException
	 */
	public static HttpClientResult doGet(String url, Map<String, Object> params, Map<String, Object> headers, HttpClientConfig config, Cookie[] cookies) throws HttpClientTimeoutException{
		return session.doGet(url, params, headers, config, cookies);
	}
}
